package qianting.news.gateway.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import qianting.news.gateway.dto.LoginDto;
import qianting.news.gateway.entity.State;

@FeignClient("auth-service")
public interface AuthClient {

    //登录
    @PostMapping("/auth/login")
    State login(LoginDto loginDto);

    //注册
    @PostMapping("/auth/register")
    State register(LoginDto loginDto);

    //校验
    @GetMapping("/auth/verify")
    State verify(@RequestHeader("token") String token);

    //刷新
    //校验
    @GetMapping("/auth/refresh")
    State refresh(@RequestHeader("token") String token);

}
